/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.view.tutorial;

import java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;

/**
 * The tutorial of how to delete a task / entry
 * 
 * @author Can
 */
public class TutorialDeleteTask extends GlassTutorial {

    public TutorialDeleteTask(TutorialContainer container) {
        super(container.getViewPanel(), container.getJMenuBar(), container.getContentPane());

        this.tutorialTitle = "How to delete?";

        this.instructions = ""
                + "To delete a task, click the \n"
                + "entry on the Month panel, \n"
                + "you will see the entry dialog  \n"
                + "open, click the 'remove' but-\n"
                + "ton to delete the entry.";
    }

    @Override
    protected void mouseEventOnLiveComponent(Point mousePoint, Component component, MouseEvent e) {
        if (e.getID() == MouseEvent.MOUSE_CLICKED) {
            this.setVisible(false);
        }
        super.mouseEventOnLiveComponent(mousePoint, component, e);
    }

    @Override
    protected Rectangle getInstructionPlace() {
        Rectangle rect = new Rectangle();
        Point location = getPoint(liveComponent.getLocation());
        location.x = 2;
        rect.setLocation(location);
        rect.width = liveComponent.getX() - 6;
        rect.height = 350;
        return rect;
    }
}
